package role;
/**
* @author: luosiyu
* @Description: 刺客
* @Date: 2022/10/22 11:20
*/
public class Assassin extends Hero implements Safe{
	private int damage2 =15;
	private int damage3=30;

	public Assassin() {
		super("刺客",100,6,8);
	}

	public int getDamage2() {
		return damage2;
	}

	public void setDamage2(int damage2) {
		this.damage2 = damage2;
	}

	public int getDamage3() {
		return damage3;
	}

	public void setDamage3(int damage3) {
		this.damage3 = damage3;
	}

	@Override
	public boolean show(int damage) {
		// TODO Auto-generated method stub
		if(getDefence()>=damage) {
			System.out.println("刺客防御值为："+getDefence()+",抗下了所有伤害");
			return false;
		}else return true;
	}
	
	@Override
	public void attacked(int dam) {
		// TODO Auto-generated method stub
		//受到攻击
//		System.out.println("刺客受到攻击");
		if(show(dam)){
			int damage2 =dam-getDefence();
			setLife(getLife() - damage2);
			System.out.println("刺客防御值为："+getDefence()+",受到"+damage2+"伤害，生命值还剩"+getLife());
		}
	}

	@Override
	public int  ChoiceDamage(int i) {
		switch (i) {
			case 1:
				return getDamage1();
			case 2:
				return getDamage2();
			case 3:
				return getDamage3();
		}
		return 0;
	}
	
}
